package com.caipos.config;

import com.caipos.akka.AkkaActorInitializer;
import com.caipos.netty.UdpServer;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class NettyUdpServerConfig {

    @Value("${udp.server.host}")
    private String udpHost;

    @Value("${udp.server.port}")
    private int udpPort;

    @Bean
    public UdpServer udpServer(AkkaActorInitializer akkaActorInitializer, ObjectMapper objectMapper) {
        return new UdpServer(udpHost, udpPort, akkaActorInitializer, objectMapper);
    }
}
    